<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
    <script>
        let str="off";
        function cnt() {
            str==="off" ? str="on" : str="off";
            alert(str)
    }

    $(function () {
            function cnt() {
                alert("111111111111")
            }
        })
    </script>
</head>
<body>
    <button onclick="cnt()">按钮</button>
</body>
</html>